home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3607 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  942 b 

  1. Path: noc.tor.hookup.net!news
  2. From: Richard Steadman <rsteadma@mmltd.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: The size of a file
  5. Date: 29 Jan 1996 20:12:11 GMT
  6. Organization: Micromedia
  7. Message-ID: <4ej9mr$fh5@noc.tor.hookup.net>
  8. References: <4ebc03$4gv@gate.compart.fi> <4edo88$4c7@news.xs4all.nl>
  9. NNTP-Posting-Host: keeper.mmltd.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. falstaff@xs4all.nl (Falstaff) wrote:
  16. >Fredrik Sandstrom <fred@spider.compart.fi> writes:
  17. >
  18. >>This is driving me nuts.  I can't find a simple way to get the size of a
  19. >>disk file.  This must be possible using the standard C library, but I
  20. >>haven't figured out how!
  21. >
  22. >f=fopen()
  23. >fseek(f,SEEK_END,0)
  24. >ftell(f)
  25. >fclose(f)
  26. >
  27. >done
  28. >--
  29.  
  30. But what if the file size doesn't fit in a long int (in DOS)? It
  31. seems that a long int (which ftell() returns) only goes up to 2 meg.
  32.  
  33.  
  34.  
  35.